<?php
/**
 * Created by PhpStorm.
 * User: krystal
 * Date: 2019/6/17
 * Time: 12:59
 */

namespace app\web\controller;


use think\Controller;
use think\Env;

class PhysicalStore extends Controller
{
    public function goods_list()
    {
        $goods = config('physical_store_goods');
        $host = Env::get('host.m');
        return $this->fetch('', ['host' => $host, 'goods' => $goods]);
    }

    public function goods_detail()
    {
        $id = request()->only('id');
        $goods = config('physical_store_goods');
        $arr = [];
        foreach ($goods as $good)
        {
            if ($good['id'] == $id['id'])
            {
                $arr = [
                    'name' => $good['name'],
                    'des' => $good['des'],
                    'texture' => $good['texture'],
                    'specification' => $good['specification'],
                    'icon' => $good['icon'],
                    'photo' => $good['photo'],
                    'photos' => $good['photos'],
                    'or_price' => $good['or_price'],
                    'now_price' => $good['now_price']
                ];
            }
        };
        return $this->fetch('', ['arr' => $arr]);
    }
}